<layout name="page" />

<block name="content">
	<form id="form_data" name="form_data" method='post'>
		<div class="operate-panel">
			<a class="btn btn-primary" onclick="daochu()">导出</a>
			<div class="split"></div>
			<input type="text" class="btn btn-primary input-date" readonly="readonly" value="{$time}" id = 'start_time' name="start_time">
			<a class="btn btn-primary" onclick="chaxun()">查询</a>
		</div>
	</form>
	<form id="form_data" name="form_data" method='post'>
		<div style="overflow-x: auto">
			<table id="targetTable" class="table table-bordered">
				<tr>
					<td>{$time}</td>
					<foreach name="head1" item="head1_vo">
						<td> {$head1_vo.name}</td>
					</foreach>
					<foreach name="head2" item="head2_vo">
						<td> {$head2_vo.name}</td>
					</foreach>
				</tr>
				<volist name="data1" id="data1_vo">
					<tr>
						<td> {$key}</td>
						<php>
							foreach($data1_vo as $k){
							if($k ==2){
							echo "<td>"."<font color='red'>".'异常'."</font></td>";
							}else if($k ==1){
							echo "<td>".'正常'."</td>";
							}else{
							echo "<td>".'未签到'."</td>";
							}

							}
							$data2_vo=$data2[$key];
							foreach($data2_vo as $k){
							if($k ==2){
							echo "<td>"."<font color='red'>".'异常'."</font></td>";
							}else if($k ==1){
							echo "<td>".'正常'."</td>";
							}else{
							echo "<td>".'无情况'."</td>";
							}

							}

						</php>

				</foreach>

			</table>

		</div>
	</form>
</block>

<block name="js">

	<script type="text/javascript" language="javascript">
		function chaxun() {
			var time = document.getElementById("start_time").value;
			send_form("form_data", "{:url('Sign/sign_total')}&time=" + time);
		}

		function danger() {
			send_form("form_data", "{:url('Sign/sign_total')}&type=" + 2);
		}

		function daochu() {
			window.open("{:url('Sign/excel')}", "_self");
		}
	</script>

</block>